/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.base.service.customerdataconfig;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.base.dao.customerdataconfig.CustomerDataconfigDao;
import com.jeesite.modules.base.entity.customerdataconfig.CustomerDataconfig;
import com.jeesite.modules.sys.utils.UserUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 客户资料附件信息配置表Service
 * @author LV
 * @version 2021-02-26
 */
@Service
@Transactional(readOnly=true)
public class CustomerDataconfigService extends CrudService<CustomerDataconfigDao, CustomerDataconfig> {
	
	/**
	 * 获取单条数据
	 * @param customerDataconfig
	 * @return
	 */
	@Override
	public CustomerDataconfig get(CustomerDataconfig customerDataconfig) {
		return super.get(customerDataconfig);
	}
	
	/**
	 * 查询分页数据
	 * @param customerDataconfig 查询条件
	 * @param customerDataconfig.page 分页对象
	 * @return
	 */
	@Override
	public Page<CustomerDataconfig> findPage(CustomerDataconfig customerDataconfig) {
		return super.findPage(customerDataconfig);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param customerDataconfig
	 */
	@Override
	@Transactional(readOnly=false)
	public void save(CustomerDataconfig customerDataconfig) {
        if (customerDataconfig.getIsNewRecord()){
            customerDataconfig.setCreateBy(UserUtils.getUser().getUserCode());
            customerDataconfig.setUpdateBy(UserUtils.getUser().getUserCode());
        }else {
            customerDataconfig.setUpdateBy(UserUtils.getUser().getUserCode());
        }
		super.save(customerDataconfig);
	}
	
	/**
	 * 更新状态
	 * @param customerDataconfig
	 */
	@Override
	@Transactional(readOnly=false)
	public void updateStatus(CustomerDataconfig customerDataconfig) {
		super.updateStatus(customerDataconfig);
	}
	
	/**
	 * 删除数据
	 * @param customerDataconfig
	 */
	@Override
	@Transactional(readOnly=false)
	public void delete(CustomerDataconfig customerDataconfig) {
		super.delete(customerDataconfig);
	}
	
}